﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Library.Json
{
    public static class JsonExtensions
    {

        public static string ToJson(this object obj)
        {
            return JsonConvert.SerializeObject(obj);
        }

        public static T FromJson<T>(this string obj) where T : class
        {
            return JsonConvert.DeserializeObject<T>(obj);
        }



    }
}
